<me:UILS x:Class="WPFExcelReport.TSLS02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UILS.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UILS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions> 
        <StackPanel Grid.Row="0">
            <WrapPanel>
                 
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=供应商:}}"></TextBlock>
                    <Button  Grid.Column="1" Click="ManageCommand" Width="12" Height="20" HorizontalAlignment="Left"
                             Visibility="{Binding IsMaster, Converter={StaticResource bv}}" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Extend.png" />
                        </Button.Background>
                    </Button>
                <TextBox  HorizontalAlignment="Left"  
                          CharacterCasing="Upper"
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                           Text="{Binding ART,ElementName=TV}"
                           KeyUp="TextBlock_KeyUp"
                          LostFocus="TextBox_LostFocus"
                           Background="Yellow"
                           
                           Width="80" />
                <Button  Grid.Column="1" Click="NewCommand" Width="24" Height="20" HorizontalAlignment="Left" 
                         Visibility="{Binding IsEdit, Converter={StaticResource bv}}">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <ComboBox x:Name="cSKD"
                    Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                    IsEditable="True" 
                    Width="Auto" 
                    MinWidth="100" 
                    SelectedValuePath="KEY" 
                    DisplayMemberPath="KEY"
                    ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                    IsSynchronizedWithCurrentItem="True" 
            >
                </ComboBox  >
                <TextBlock HorizontalAlignment="Left"  
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                           Text="{Binding LSLIEFNA,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}"
                           Width="80" />
            </WrapPanel>
            <DataGrid  Grid.Row="1"  
                       Visibility="Collapsed"
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"
                   GridLinesVisibility="All"
                   MaxHeight="400"
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=LSLIEFNR}" Header="{Binding Source={Localization:Translate Word=编号}}"  Width="Auto" />
                     <DataGridTextColumn Binding="{Binding Path=LSLIEFNA}" Header="{Binding Source={Localization:Translate Word=总公司编号}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel> 
    </Grid>
</me:UILS>
